<template>
  <div class="add-form">
    <el-dialog :title="titleInfo.pageTitle"  width="40%" :visible.sync="dialogTableVisible">
      <el-card class="box-card" shadow="never" style="border-radius: 0px;">
        <span style="color:#909399;">用户名</span>
        <div style="float:right; padding: 3px 0">
            张艳新
        </div>
      </el-card>
      <el-card class="box-card" shadow="never">
        <span style="color:#909399;">Email</span>
        <div style="float:right; padding: 3px 0">
            renyun@itcast.cn
        </div>
      </el-card>
      <el-card class="box-card" shadow="never">
        <span style="color:#909399;">注册时间/IP</span>
        <div style="float:right; padding: 3px 0">
            2017-09-13 10:33:22 / 10.10.10.10
        </div>
      </el-card>
      <el-card class="box-card" shadow="never">
        <span style="color:#909399;">最近登录时间/IP</span>
        <div style="float:right; padding: 3px 0">
            2017-09-13 10:33:22 / 10.10.10.10
        </div>
      </el-card>
    </el-dialog>
  </div>
</template>
<script>
// import { add } from '@/api/xczx/category'
export default {
  name: 'Author',
  props: {
    titleInfo: {
      type: Object,
      required: true
    },
    formBase: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      dialogTableVisible: false,
      dataForm: {
        lable: '1'
      },
      // 表单验证
      ruleInline: {
        name: [
          { required: true, message: '分类名称不能为空', trigger: 'blur' }
        ],
        code: [
          { required: true, message: '编码不能为空', trigger: 'blur' }
        ]
      }
    }
  },
  computed: {},
  methods: {
    // 弹层显示
    dialogFormV() {
      this.dialogTableVisible = true
    },
    // 弹层隐藏
    dialogFormH() {
      this.dialogTableVisible = false
    },
    // 表单提交
    createData() {
      this.$refs['dataForm'].validate(async valid => {
        if (valid) {
          this.dialogFormH()
          let data = {
            ...this.formBase
          }
          if (this.formBase.courseCategoryId) {
              await add(data).then(() => {
                this.$emit('newDataes')
              })
          }
        } else {
          this.$message.error('*号为必填项!')
        }
      })
    }
  },
  // 挂载结束
  mounted: function() {},
  // 创建完毕状态
  created() {

  },
  // 组件更新
  updated: function() {}
}
</script>
<style>
.el-form--label-left .el-form-item__label {
  text-align: right;
}
.el-form-item--medium {
  margin-bottom: 22px;
}
.el-dialog__footer {
  text-align: center;
}
</style>
